<template>
  <div id="app">
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
  <el-menu-item  index="1">socketio聊天室</el-menu-item>
  <el-menu-item index="2">本地1对1直播</el-menu-item>
  <el-menu-item index="3">socketio的1对1直播</el-menu-item>

</el-menu>






<!-- 
    <img src="./assets/logo.png"> -->
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
      data() {
      return {
        activeIndex: '1',
      };
    },
  methods:{
      handleSelect(key, keyPath) {
        console.log(key)
        switch (key){
          case '1':
              this.$router.push('chat')
              break
          case '2':
              this.$router.push('onetoone')
              break     
          case '3':
              this.$router.push('skonetoone')
              break                
          default:
              alert('访问错误')
            break    
        }

        // this.$router.push('chat')
        // console.log(key, keyPath);
      }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;

}
</style>
